// 文章接口
import request from "@/utils/request";
// 发布文档
export function PublishDocument(data) {
    return request({
        url: "/api/v1/document/publishDocument",
        method: "post",
        data,
    });
}
// 获取文档列表
export function getDocumentList(limit, page) {
    return request({
        url: `/api/v1/document/getDocumentList/${limit}/${page}`,
        method: "get",
    });
}
// 获取文档评论列表
export function getCommentList(document_id, limit, page) {
    return request({
        url: `/api/v1/document/getCommentList/${document_id}/${limit}/${page}`,
        method: "get",
    });
}
// 添加文档评论
export function addComment(data) {
    return request({
        url: `/api/v1/document/addComment`,
        method: "post",
        data
    });
}
// 通过用户id获取文档
export function getDocumentByAuthorId(user_id, limit, page) {
    return request({
        url: `/api/v1/document/getDocumentsByAuthor/${user_id}/${limit}/${page}`,
        method: "get",
    });
}
// 删除文档
export function deleteDocument(data) {
    return request({
        url: `/api/v1/document/deleteDocument`,
        method: "delete",
        data
    });
}
// 修改文档
export function alterDocument(data) {
    return request({
        url: `/api/v1/document/alter`,
        method: "put",
        data
    });
}
// 获取文档下载量排行
export function getRankDownloadList() {
    return request({
        url: `/api/v1/document/rank/download`,
        method: "get",
    });
}
// 添加下载数
export function addDownloadNum(id) {
    return request({
        url: `/api/v1/document/download/${id}`,
        method: "post",

    });
}
// 文档点赞
export function documentThumb(data) {
    return request({
        url: `/api/v1/document/like`,
        method: "post",
        data
    });
}
// 删除文档评论
export function deleteDocumentComment(data) {
    return request({
        url: `/api/v1/comment/deleteDocumentComment`,
        method: "delete",
        data,
    });
}
// 通过tagId获取文档
export function getDocumentsByTagId(tagId, limit, page) {
    return request({
        url: `/api/v1/tag/getDocumentByTagId/${tagId}/${limit}/${page}`,
        method: "get",
    });
}